import { http } from "@/utils/http";
import { baseUrlApi } from "../utils";


interface GetDataIntegrationPage {
  status: number;
  msg: string;
  data: {
    apiInfoId: string;
    apiName: string;
    requestMethod: string;
    supplier: string;
    requestParams: string;
    respondBody: string;
    respondData: string;
    apiKey: string;
  };
  success: boolean;
}

interface AddOrUpdataBankAPIInfo {
  userId: string;
  classId: string;
  studentAnswer: string;
  planId: string;
  taskId: string;
  userApiInfoId: string;
  apiInfoId: string;
  auth: number;
  isShowRespondData: number;
  apiKey: string;
}

interface GetReport {
  status: number;
  msg: string;
  data: boolean;
  success: boolean;
}

// 查询接口  - 获取信息
export const GetDataIntegrationPage = () => {
  return http.request<GetDataIntegrationPage>(
    "get",
    baseUrlApi("/BankBigData/GetDataIntegrationPage")
  );
};

//查询参数预览
export const GenerateRespondDataPreview = (data: object) => {
  return http.request<GetReport>(
    "post",
    baseUrlApi("/BankBigData/GenerateRespondDataPreview"),
    { data }
  );
};

// 保存 查看 接口
// 查询接口  - 获取信息
export const AddOrUpdataBankAPIInfo = (data: object) => {
  return http.request<GetReport>(
    "post",
    baseUrlApi("/BankBigData/AddOrUpdataBankAPIInfo"),
    { data }
  );
};


// 获取左侧列表数据
export const GetApiInfoList = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/GetApiInfoList"), {
    data
  });
};

// 数据整合end  数据共享start
//数据共享列表数据
export const GetApiInfoDataShareList = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/GetApiInfoDataShareList"), {
    data
  });
};

//获取添加完的数据
export const GetApiInterfaceDataInfo = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/GetApiInterfaceDataInfo"), {
    data
  });
};

//新建接口共享
export const AddOrUpdataApiInfoDataShare = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/AddOrUpdataApiInfoDataShare"), {
    data
  });
};
//数据接入选择列表
export const GetShareDataSelectList = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/GetShareDataSelectList"), {
    data
  });
};

//获取接入数据表头
export const GetUserApiFields = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/GetUserApiFields"), {
    data
  });
};

//导入数据

export const ImportShareData = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/ImportShareData"), {
    data
  });
};

//查看导入的数据列表
export const GetInterfaceDataInfo = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/GetInterfaceDataInfo"), {
    data
  });
};

//获取画像指数基本数据
export const GetPortraitIndexModelBaseData = () => {
  return http.request<any>(
    "get",
    baseUrlApi("/BankBigData/GetPortraitIndexModelBaseData")
  );
};

//保存画像模型
export const AddOrUpdataPortraitIndexSystem = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/BuildPortraitIndexSystem"), {
    data
  });
};


//获取画像模型列表
export const GetPortraitIndexSystemList = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/GetPortraitIndexSystemList"), {
    data
  });
};


//模型画像详情
export const GetPortraitIndexSystemDetail = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/GetPortraitIndexSystemDetail"), {
    data
  });
};

//用户评分列表
export const GetIndexModelRateList = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/GetIndexModelRateList"), {
    data
  });
};
//获取新增用户评分用到的数据
export const GetIndexModexRateBaseData = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/GetIndexModexRateBaseData"), {
    data
  });
};
//新增用户评分
export const AddIndexModelRate = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/AddIndexModelRate"), {
    data
  });
};

//获取评分结果
export const GetScoreResult = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/GetScoreResult"), {
    data
  });
};

//获取创建任务基本参数
export const GetAddUserProfilingTaskBase = () => {
  return http.request<any>(
    "get",
    baseUrlApi("/BankBigData/GetAddUserProfilingTaskBase")
  );
};
//创建任务
export const AddUserProfilingTask = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/AddUserProfilingTask"), {
    data
  });
};
//获取创建任务列表
export const GetUserProfilingTaskList = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/GetUserProfilingTaskList"), {
    data
  });
};

//获取任务客户信息
export const GetCustomerInfo = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/GetCustomerInfo"), {
    data
  });
};

//获取新建图标相关数据
export const GetAddUserProfileChartBaseData
  = (data: object) => {
    return http.request<any>("post", baseUrlApi("/BankBigData/GetAddUserProfileChartBaseData"), {
      data
    });
  };
//新增图表
export const AddUserProfileChart
  = (data: object) => {
    return http.request<any>("post", baseUrlApi("/BankBigData/AddUserProfileChart"), {
      data
    });
  };

export const GetChartData
  = (data: object) => {
    return http.request<any>("post", baseUrlApi("/BankBigData/GetChartData"), {
      data
    });
  };

//获取推送任务基本数据
export const GetPushTaskBaseData
  = (data: object) => {
    return http.request<any>("post", baseUrlApi("/BankBigData/GetPushTaskBaseData"), {
      data
    });
  };

//获取推送任务列表
export const PushTaskList
  = (data: object) => {
    return http.request<any>("post", baseUrlApi("/BankBigData/PushTaskList"), {
      data
    });
  };

//新增推送任务
export const AddPushTask
  = (data: object) => {
    return http.request<any>("post", baseUrlApi("/BankBigData/AddPushTask"), {
      data
    });
  };

//第三个模块
//获取客群筛选基本参数
export const GetAddCreditScoreUserGroupBaseData = () => {
  return http.request<any>(
    "get",
    baseUrlApi("/BankBigData/GetAddCreditScoreUserGroupBaseData")
  );
};

//获取客群列表
export const GetCreditScoreUserGroupList = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/GetCreditScoreUserGroupList"), {
    data
  });
};

//新增客群
export const AddCreditScoreUserGroup = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/AddCreditScoreUserGroup"), {
    data
  });
};

//查看详情列表
export const QueryCreditScoreCustomerInfo = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/QueryCreditScoreCustomerInfo"), {
    data
  });
};


//创建信用评分模型任务

//获取列表
export const UserCreditScoringList = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/UserCreditScoringList"), {
    data
  });
};

//新增
export const AddUserCreditScoring = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/AddUserCreditScoring"), {
    data
  });
};

//查看结果
export const QueryScoreResult = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/QueryScoreResult"), {
    data
  });
};

export const GetAddUserCreditScoringBaseData = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/GetAddUserCreditScoringBaseData"), {
    data
  });
};

export const QueryUserCreditScoringDetail = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/QueryUserCreditScoringDetail"), {
    data
  });
};
//审批策略基本数据
export const BuildApprovalPolicyModelBaseData = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/BuildApprovalPolicyModelBaseData"), {
    data
  });
};
//审批策略添加
export const BuildApprovalPolicyModel = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/BuildApprovalPolicyModel"), {
    data
  });
};
//审批策略列表
export const ApprovalPolicyModelList = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/ApprovalPolicyModelList"), {
    data
  });
};
//审批策略结果
export const QueryApprovalResult = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/QueryApprovalResult"), {
    data
  });
};
//审批策略详情
export const ApprovalPolicyModelDetail = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/ApprovalPolicyModelDetail"), {
    data
  });
};
//客户评级信息
export const QueryRatingCustomerInfo = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/QueryRatingCustomerInfo"), {
    data
  });
};

//修改查看状态 客户信息1 逾期客户2
export const LookInfo = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/LookInfo"), {
    data
  });
};

//获取查看状态
export const IsLooked = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/IsLooked"), {
    data
  });
};


//客户评级构建基本信息
export const InternalRatingModelBaseData = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/InternalRatingModelBaseData"), {
    data
  });
};

//构建内部评级模型
export const BuildInternalRatingModel = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/BuildInternalRatingModel"), {
    data
  });
};

//内部评级模型列表
export const InternalRatingModelList = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/InternalRatingModelList"), {
    data
  });
};
//内部评级模型详情
export const InternalRatingModelDetail = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/InternalRatingModelDetail"), {
    data
  });
};

//评级结果和应用
//基本数据
export const ObtainInternalRatingResultBaseData = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/ObtainInternalRatingResultBaseData"), {
    data
  });
};
//应用列表数据
export const InternalRatingResultsObtainList = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/InternalRatingResultsObtainList"), {
    data
  });
};

//添加列表
export const ObtainInternalRatingResult = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/ObtainInternalRatingResult"), {
    data
  });
};

//获取echarts
export const QueryInternalRatingResultChart = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/QueryInternalRatingResultChart"), {
    data
  });
};

//获取内部评级用户信息
export const QueryInternalRatingResultUserInfo = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/QueryInternalRatingResultUserInfo"), {
    data
  });
};


//结果应用
export const ApplicationRatingResults = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/ApplicationRatingResults"), {
    data
  });
};

//风险策略
//基本数据
export const BuildRiskControlModelBaseData = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/BuildRiskControlModelBaseData"), {
    data
  });
};
//列表
export const RiskControlStrategyModelList = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/RiskControlStrategyModelList"), {
    data
  });
};

//新增
export const BuildRiskControlStrategyModel = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/BuildRiskControlStrategyModel"), {
    data
  });
};

//详情
export const RiskControlStrategyModelDetail = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/RiskControlStrategyModelDetail"), {
    data
  });
};

//风险
//基本数据
export const MonitoringStrategyAccessBaseData
  = (data: object) => {
    return http.request<any>("post", baseUrlApi("/BankBigData/MonitoringStrategyAccessBaseData"), {
      data
    });
  };//接入
export const MonitoringStrategyAccess = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/MonitoringStrategyAccess"), {
    data
  });
};//列表
export const MonitoringStrategyAccessList = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/MonitoringStrategyAccessList"), {
    data
  });
};//预警信息列表
export const WarningInformationList = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/WarningInformationList"), {
    data
  });
};
//逾期客户列表
export const OverdueUserList = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/OverdueUserList"), {
    data
  });
};
//催收策略基本数据
export const BuildCollectionStrategyBaseData = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/BuildCollectionStrategyBaseData"), {
    data
  });
};
//构建催收策略
export const BuildCollectionStrategy = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/BuildCollectionStrategy"), {
    data
  });
};
//催收策略列表
export const CollectionStrategyList = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/CollectionStrategyList"), {
    data
  });
};
export const CollectionStrategyDetail = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/CollectionStrategyDetail"), {
    data
  });
};

//催收任务
export const CreateCollectionTaskBaseData = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/CreateCollectionTaskBaseData"), {
    data
  });
};

export const CollectionTaskList = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/CollectionTaskList"), {
    data
  });
};

export const CreateCollectionTask = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/CreateCollectionTask"), {
    data
  });
};

export const CollectionTaskDetail = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/CollectionTaskDetail"), {
    data
  });
};
export const ApplicationCollectionStrategy = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/ApplicationCollectionStrategy"), {
    data
  });
};
export const QueryCollectionEffect = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/QueryCollectionEffect"), {
    data
  });
};

export const QueryCollectionEffectStatistics = (data: object) => {
  return http.request<any>("post", baseUrlApi("/BankBigData/QueryCollectionEffectStatistics"), {
    data
  });
};
